<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            margin: 0;
            padding: 0;
        }

        #canvas {
            background: rebeccapurple;
        }
    </style>
</head>

<body>
    <canvas id="canvas"></canvas>
</body>

<script>

    window.onload = function () {

        const canvas = document.getElementById("canvas");
        canvas.width = window.innerWidth;
        canvas.height = window.innerHeight;

        //三维画笔
        const gl = canvas.getContext("webgl");

        const backgorundRGB = "rgba(128,128,128,1)";
        const reg = RegExp(/\((.*)\)/)

        const rgbaStr = reg.exec(backgorundRGB)[1].split(',').map((n) => parseInt(n));
        console.log(rgbaStr)
        //set清空绘图区的颜色
        gl.clearColor(
            rgbaStr[0] / 255,
            rgbaStr[1] / 255,
            rgbaStr[2] / 255,
            rgbaStr[3]);
        //清空
        gl.clear(gl.COLOR_BUFFER_BIT);

        var map = new Map();

        console.log(map.get(1))


        fetch('http://localhost:9000/galgame/').then(red => {
            console.log(res)
        })

    }



</script>

</html>